<div class="ui-g">
  <!-- 搜索 begin-->
  <div class="ui-g-12 ui-g-nopad">
      <p-panel header="筛选查询" [collapsed]="false" headerClass="bg-eaeaea border-none" search="用户ID/手机号" (onSearch)="search($event);"  (searchTextChange)="searchTextChange($event);">
              <div class="m-r-15 inline-block">
                  <span class="p-r-10">发送对象： </span>
                  <p-dropdown [justValue]="true" dataKey="code" optionLabel="name" styleClass="width-150" [options]="resouceTypeArr" [(ngModel)]="searchObj.resouceType" (onChange)="search()"></p-dropdown>
          </div>
          <div class="m-r-15 inline-block">
                  <span class="p-r-10">状态： </span>
                  <p-dropdown [justValue]="true" dataKey="code" optionLabel="name" styleClass="width-150" [options]="statusArr" [(ngModel)]="searchObj.status" (onChange)="search()"></p-dropdown>
          </div>
      </p-panel>
  </div>
  <!-- 搜索 end-->

  <!-- 列表 begin-->
  <div class="ui-g-12 ui-g-nopad m-t-20">
      <div class="content-section implementation b-b-25">
          <p-dataTable [value]="listData" [totalRecords]="totalRecords" [rows]="20" [rowsPerPageOptions]="[20,50,100,300]" [loading]="loading"
              [lazy]="true" (onLazyLoad)="loadCarsLazy($event)" scrollHeight="100px" [paginator]="true" [pageLinks]="4" [(selection)]="selectedItem"
              [headerCheckboxToggleAllPages]="true" [emptyMessage]="'没有搜到您想要的数据'">
              <p-header>
                  <button pButton type="button" label="处理" class="btn btn-secondary" (click)="disposeShow()"></button>
              </p-header>
              <p-column [style]="{'width':'38px'}" selectionMode="multiple" ></p-column>
              <p-column *ngFor="let col of colsSelected" [field]='col.field' [header]='col.header' [sortable]="col.sortable" [style]="{'width':col.width}" >
                  <ng-template let-index='rowIndex' let-data='rowData' pTemplate='body' *ngIf="col.tem">
                      <div *ngIf="col.field === 'code'" (click)="edit(data.code)" style="color:#1a91eb;cursor:pointer;">
                          {{data.code}}
                      </div>
                      <div *ngIf="col.field === 'imagePath'" (click)="lookImagesUrl= data.imagePath;lookImages.toggle($event)" style="color:#1a91eb;cursor:pointer;">
                          查看
                      </div>
                      <div *ngIf="col.field === 'forwardUrl'" (click)="openWin(data.forwardUrl)" style="color:#1a91eb;cursor:pointer;">
                          {{data.forwardUrl}}
                      </div>
                  </ng-template>
              </p-column>
          </p-dataTable>
      </div>

  </div>
  <!-- 列表 end-->

  <!-- 表单 begin-->
  <p-dialog [header]="showTitle" [(visible)]="isShow" modal="modal" width="700" [responsive]="true" (onHide)="search()">
    <div class="text-center">
        <div class="inline-block">
            <form #form="ngForm" (ngSubmit)="form.form.valid" novalidate class="form-horizontal" role="form" [ngClass]="" >

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 p-required">状态：</div>
                    <div class="table-cell relative">
                        <p-dropdown name="status" styleClass="p-calendar text-left"  [style]="{'width':'100%'}" [options]="statusArr2"
                            [(ngModel)]="formObj.status" [justValue]="true" dataKey="code" optionLabel="name" (onChange)="changeStatus();"></p-dropdown>
                        <p-message [severity]="'error'" styleClass="p-right" 
                            [text]="{'请选择状态':errorObj.status?.show}">
                        </p-message>
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 v-top p-required">备注：</div>
                    <div class="table-cell relative">
                        <textarea rows="5" cols="35" name='note' #note [(ngModel)]="formObj.note" class="width-full" maxlength="50" pInputTextarea
                            (blur)="verifyFields(note,formObj);" (focus)="submited=false;clearVerify(note);" 
                            [ngClass]="(!(formObj.note?.length>0))&&(errorObj.note?.show || submited ) ? 'p-input-error' : ''" ></textarea>
                        <div class="text-right opacity06">还可输入{{50 - (formObj.note?.length || 0)}}个字</div>
                        <p-message styleClass="p-right m-t-10" [severity]="'error'" [text]="{'请输入备注':(!(formObj.note?.length>0))&&(errorObj.note?.show || submited )}">
                        </p-message>
                    </div>
                    
                </div>
                <div class="table-row">
                    <div class="table-cell text-right p-l-25"></div>
                    <div class="table-cell text-left">
                        <button pButton type="button"  [label]="'保存'" class="btn-success" style="left: 70px;" (click)="submited=true;disposeSave();"></button>
                    </div>
                </div>
            </form>
        </div>
    </div>
  </p-dialog>
  <!-- 表单 end-->

</div>